package com.yanfei.zero.domain.user.model;


import java.io.Serializable;
import java.math.BigDecimal;

import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;
import org.springframework.format.annotation.NumberFormat;
import org.springframework.format.annotation.NumberFormat.Style;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.persistence.Entity;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType;
import jakarta.persistence.Id;
import jakarta.persistence.Table;
import jakarta.validation.constraints.Email;
import jakarta.validation.constraints.NotBlank;
import lombok.Data;

@Entity
@Table(name="user1")
@Schema(name = "用户")
@Data
public class User1 implements Serializable{
    
	
    public User1() {
	}

	@Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private Long id;
    
    @NotBlank(message = "用户名不能为空")
    @Schema(description ="用户名")
    private String name;


	@NotBlank(message = "用户密码不能为空")
    @Schema(description ="用户密码")
    private String password;
    
    @NotBlank(message = "邮箱不能为空")
    @Schema(description ="邮箱")
    @Field(type = FieldType.Keyword,index = true)
    @Email(message = "邮箱格式不正确")
    private String email;
    
    @NumberFormat()
    @Schema(description ="余额")
    private BigDecimal money;
    
    
    @NumberFormat()
    @Schema(description ="角色")
    private String role;
    
    @NumberFormat()
    @Schema(description ="状态")
    private String status;

	
    
    // standard constructors / setters / getters / toString
    
        
}
